package com.zpark.signup.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

import com.zpark.signup.validate.ValidatedGroup;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;

/**
 * 竞赛项目表
 *
 * @TableName competition_project
 */
@TableName(value = "competition_project")
@Data
@ApiModel("竞赛项目对象模型")
public class CompetitionProject implements Serializable {
    /**
     * 比赛项目的唯一标识符
     */
    @TableId(type = IdType.AUTO)
    @NotNull(message = "id不能为空", groups = {ValidatedGroup.UPDATE.class})
    @ApiModelProperty("比赛项目的唯一标识符")
    private Integer id;

    /**
     * 比赛项目的名称
     */
    @NotNull(message = "比赛名称不能为空", groups = {ValidatedGroup.CREATE.class})
    @ApiModelProperty("比赛项目的名称")
    private String name;

    /**
     * 类型
     */
    @NotNull(message = "比赛类型不能为空", groups = {ValidatedGroup.CREATE.class})
    @ApiModelProperty("类型")
    private String type;

    /**
     * 比赛项目所属的类别
     */
    @NotNull(message = "比赛类别不能为空", groups = {ValidatedGroup.CREATE.class})
    @ApiModelProperty("比赛项目所属的类别")
    private String category;

    /**
     * 对比赛项目的简要描述
     */
    @NotNull(message = "项目描述不能为空", groups = {ValidatedGroup.CREATE.class})
    @ApiModelProperty("对比赛项目的简要描述")
    private String description;

    /**
     * 比赛项目的开始时间
     */
    @NotNull(message = "比赛开始时间不能为空", groups = {ValidatedGroup.CREATE.class})
    @ApiModelProperty("比赛项目的开始时间")
    private Date startTime;

    /**
     * 比赛项目的结束时间
     */
    @NotNull(message = "比赛结束时间不能为空", groups = {ValidatedGroup.CREATE.class})
    @ApiModelProperty("比赛项目的结束时间")
    private Date endTime;

    /**
     * 比赛项目的参赛人数上限
     */
    @NotNull(message = "参赛人数上限不能为空", groups = {ValidatedGroup.CREATE.class})
    @ApiModelProperty("比赛项目的参赛人数上限")
    private Integer maxParticipants;

    /**
     * 参赛者报名的截止时间
     */
    @NotNull(message = "报名截至时间不能为空", groups = {ValidatedGroup.CREATE.class})
    @ApiModelProperty("参赛者报名的截止时间")
    private Date registrationDeadline;

    /**
     * 比赛项目的奖项设置
     */
    @NotNull(message = "奖项设置不能为空", groups = {ValidatedGroup.CREATE.class})
    @ApiModelProperty("比赛项目的奖项设置")
    private String awardSetting;

    /**
     * 比赛项目的组织单位或机构
     */
    @NotNull(message = "比赛项目组织单位不能为空", groups = {ValidatedGroup.CREATE.class})
    @ApiModelProperty("比赛项目的组织单位或机构")
    private String organizingUnit;

    /**
     * 比赛项目的联系人或负责人
     */
    @NotNull(message = "比赛项目联系人不能为空", groups = {ValidatedGroup.CREATE.class})
    @ApiModelProperty("比赛项目的联系人或负责人")
    private String contactPerson;

    /**
     * 比赛项目的联系方式
     */
    @NotNull(message = "比赛项目联系方式不能为空", groups = {ValidatedGroup.CREATE.class})
    @ApiModelProperty("比赛项目的联系方式")
    private String contactInfo;

    /**
     * 参加比赛项目的必要条件
     */
    @NotNull(message = "比赛项目条件不能为空", groups = {ValidatedGroup.CREATE.class})
    @ApiModelProperty("参加比赛项目的必要条件")
    private String entryRequirements;

    /**
     * 参加比赛项目需要支付的费用
     */
    @NotNull(message = "比赛项目所需费用不能为空", groups = {ValidatedGroup.CREATE.class})
    @ApiModelProperty("参加比赛项目需要支付的费用")
    private BigDecimal entryFee;

    /**
     * 比赛项目的地点或举办地
     */
    @NotNull(message = "比赛项目地点不能为空", groups = {ValidatedGroup.CREATE.class})
    @ApiModelProperty("比赛项目的地点或举办地")
    private String location;

    /**
     * 与比赛项目相关的文件或资料
     */
    @ApiModelProperty("与比赛项目相关的文件或资料")
    private String relatedFiles;

    /**
     * 附件地址
     */
    @ApiModelProperty("附件地址")
    private String attachmentAddress;

    /**
     * 比赛项目的状态（如进行中、已结束等）
     */
    @ApiModelProperty("比赛项目的状态（如进行中、已结束等）")
    private Object status;

    /**
     * 创建时间
     */
    @ApiModelProperty("创建时间")
    private Date createTime;

    /**
     * 更新时间
     */
    @ApiModelProperty("更新时间")
    private Date updateTime;

    /**
     *
     */
    @ApiModelProperty("备注")
    private String remark;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        CompetitionProject other = (CompetitionProject) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
                && (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
                && (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType()))
                && (this.getCategory() == null ? other.getCategory() == null : this.getCategory().equals(other.getCategory()))
                && (this.getDescription() == null ? other.getDescription() == null : this.getDescription().equals(other.getDescription()))
                && (this.getStartTime() == null ? other.getStartTime() == null : this.getStartTime().equals(other.getStartTime()))
                && (this.getEndTime() == null ? other.getEndTime() == null : this.getEndTime().equals(other.getEndTime()))
                && (this.getMaxParticipants() == null ? other.getMaxParticipants() == null : this.getMaxParticipants().equals(other.getMaxParticipants()))
                && (this.getRegistrationDeadline() == null ? other.getRegistrationDeadline() == null : this.getRegistrationDeadline().equals(other.getRegistrationDeadline()))
                && (this.getAwardSetting() == null ? other.getAwardSetting() == null : this.getAwardSetting().equals(other.getAwardSetting()))
                && (this.getOrganizingUnit() == null ? other.getOrganizingUnit() == null : this.getOrganizingUnit().equals(other.getOrganizingUnit()))
                && (this.getContactPerson() == null ? other.getContactPerson() == null : this.getContactPerson().equals(other.getContactPerson()))
                && (this.getContactInfo() == null ? other.getContactInfo() == null : this.getContactInfo().equals(other.getContactInfo()))
                && (this.getEntryRequirements() == null ? other.getEntryRequirements() == null : this.getEntryRequirements().equals(other.getEntryRequirements()))
                && (this.getEntryFee() == null ? other.getEntryFee() == null : this.getEntryFee().equals(other.getEntryFee()))
                && (this.getLocation() == null ? other.getLocation() == null : this.getLocation().equals(other.getLocation()))
                && (this.getRelatedFiles() == null ? other.getRelatedFiles() == null : this.getRelatedFiles().equals(other.getRelatedFiles()))
                && (this.getAttachmentAddress() == null ? other.getAttachmentAddress() == null : this.getAttachmentAddress().equals(other.getAttachmentAddress()))
                && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
                && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
                && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
                && (this.getRemark() == null ? other.getRemark() == null : this.getRemark().equals(other.getRemark()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
        result = prime * result + ((getType() == null) ? 0 : getType().hashCode());
        result = prime * result + ((getCategory() == null) ? 0 : getCategory().hashCode());
        result = prime * result + ((getDescription() == null) ? 0 : getDescription().hashCode());
        result = prime * result + ((getStartTime() == null) ? 0 : getStartTime().hashCode());
        result = prime * result + ((getEndTime() == null) ? 0 : getEndTime().hashCode());
        result = prime * result + ((getMaxParticipants() == null) ? 0 : getMaxParticipants().hashCode());
        result = prime * result + ((getRegistrationDeadline() == null) ? 0 : getRegistrationDeadline().hashCode());
        result = prime * result + ((getAwardSetting() == null) ? 0 : getAwardSetting().hashCode());
        result = prime * result + ((getOrganizingUnit() == null) ? 0 : getOrganizingUnit().hashCode());
        result = prime * result + ((getContactPerson() == null) ? 0 : getContactPerson().hashCode());
        result = prime * result + ((getContactInfo() == null) ? 0 : getContactInfo().hashCode());
        result = prime * result + ((getEntryRequirements() == null) ? 0 : getEntryRequirements().hashCode());
        result = prime * result + ((getEntryFee() == null) ? 0 : getEntryFee().hashCode());
        result = prime * result + ((getLocation() == null) ? 0 : getLocation().hashCode());
        result = prime * result + ((getRelatedFiles() == null) ? 0 : getRelatedFiles().hashCode());
        result = prime * result + ((getAttachmentAddress() == null) ? 0 : getAttachmentAddress().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        result = prime * result + ((getRemark() == null) ? 0 : getRemark().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", name=").append(name);
        sb.append(", type=").append(type);
        sb.append(", category=").append(category);
        sb.append(", description=").append(description);
        sb.append(", startTime=").append(startTime);
        sb.append(", endTime=").append(endTime);
        sb.append(", maxParticipants=").append(maxParticipants);
        sb.append(", registrationDeadline=").append(registrationDeadline);
        sb.append(", awardSetting=").append(awardSetting);
        sb.append(", organizingUnit=").append(organizingUnit);
        sb.append(", contactPerson=").append(contactPerson);
        sb.append(", contactInfo=").append(contactInfo);
        sb.append(", entryRequirements=").append(entryRequirements);
        sb.append(", entryFee=").append(entryFee);
        sb.append(", location=").append(location);
        sb.append(", relatedFiles=").append(relatedFiles);
        sb.append(", attachmentAddress=").append(attachmentAddress);
        sb.append(", status=").append(status);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", remark=").append(remark);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}